﻿using System;

namespace Innovative.ProXr
{
	/// <summary>
	/// Converts a relay count to a RelayByte array.
	/// </summary>
	public class TimeSpanParameterConverter : IParameterConverter<TimeSpan>
	{
		RelayByte[] IParameterConverter<TimeSpan>.Convert(TimeSpan parameter)
		{
			RelayByte[] returnValue = new RelayByte[3];

			returnValue[0] = (byte)parameter.Hours;
			returnValue[1] = (byte)parameter.Minutes;
			returnValue[2] = (byte)parameter.Seconds;

			return returnValue;
		}
	}
}
